﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0040)http://www.cssrain.cn/demo/3/mouse/a.htm -->
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<SCRIPT type=text/javascript>
function mouseMove(ev){
  ev = ev || window.event;
  var mousePos = mouseCoords(ev);
  document.getElementById('xxx').value = mousePos.x;
  document.getElementById('yyy').value = mousePos.y;
}

function mouseCoords(ev){
  if(ev.pageX || ev.pageY){
    return {x:ev.pageX, y:ev.pageY};
  }
  return {
    x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
    y:ev.clientY + document.body.scrollTop - document.body.clientTop
  };
}

document.onmousemove = mouseMove;
</SCRIPT>

<META content="MSHTML 6.00.2900.3429" name=GENERATOR></HEAD>
<BODY><BR><BR><BR><BR><BR><BR><BR><BR>
    <textarea id="TextArea1" cols="20" rows="2"></textarea><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>X:<INPUT 
id=xxx> Y:<INPUT id=yyy> 
<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR></BODY></HTML>
